package com.fs.service.impl;

import com.fs.mapper.VideosMapper;
import com.fs.pojo.Videos;
import com.fs.service.VideosService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;

@Service
public class VideosServiceImpl implements VideosService {
    @Autowired
    private VideosMapper videosMapper;
    @Override
    @Transactional
    public void saveVideo(Videos videos) {
        videos.setStatus(1);
        videos.setLikeCounts(0);
        videos.setCreateTime(new Date());
        videosMapper.insert(videos);
    }
}